#include <iostream>
using namespace std;

int a, b, n;

long long min_expense()
{
    long long money = 0;
    if (a * 3 > b * 2)
    {
        // 尽量选择B船
        int rest = n % 3;
        int numsB = n / 3;
        money = numsB * b;
        // 剩下的 <= 2人
        if (rest > 0)
        {
            money += min(a, b);
        }
    }
    else
    {
        // 尽量选择A船
        int rest = n % 2;
        int numsB = n / 2;
        money = numsB * a;
        // 剩下的 <= 1人
        if (rest > 0)
        {
            money += min(a, b);
        }
    }
    return money;
}
int main()
{
    int T;
    cin >> T;
    while (T--)
    {
        cin >> n >> a >> b;
        cout << min_expense() << endl;
    }
    return 0;
}